package com.example.nacos.nacosdemo;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: homeWork
 * @description:
 * @author: hezhiqin
 * @create: 2020-02-05 17:05
 */
@NacosPropertySource(dataId = "hello",groupId = "DEFAULT_GROUP",autoRefreshed = true)
@RestController
public class NacosController {

    @NacosValue(value = "${hello}",autoRefreshed = true)
    private String hello;

    @GetMapping("/hello")
    public String hello(){
        return hello;
    }
}
